{{ if $.Param "enableLangChange" }}
<div class="dropdown">
  <button class="dropdown-trigger" aria-label="Select Theme Button">
    {{ partial "svgs/etc/translate.svg" (dict "width" 24 "height" 24) }}
  </button>
  <div class="dropdown-content">
    {{ $siteLanguages := .Site.Languages }}
    {{ $pageLang := .Page.Lang }}
    {{ range .Page.AllTranslations }}
      {{ $translation := . }}
      {{ range $siteLanguages }}
        {{ if eq $translation.Lang .Lang }}
        {{ $selected := false }}
          {{ if eq $pageLang .Lang }}
            {{ if .LanguageName }}
              <a href="{{ $translation.Permalink }}" data-lang="{{ .Lang }}" class="dropdown-item is-active">{{ .LanguageName }}</a>
            {{ end }}
          {{ else }}
            {{ if .LanguageName }}
              <a href="{{ $translation.Permalink }}" data-lang="{{ .Lang }}" class="dropdown-item">{{ .LanguageName }}</a>
            {{ end }}
          {{ end }}
        {{ end }}
      {{ end }}
    {{ end }}
  </div>
</div>
{{ end }}